package com.edu.exam.enums.quality;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 巡检优先级枚举
 */
@Getter
@AllArgsConstructor
public enum PatrolPriorityLevel {
    LOW("LOW", "低优先级"),
    MEDIUM("MEDIUM", "中优先级"),
    HIGH("HIGH", "高优先级"),
    URGENT("URGENT", "紧急"),
    CRITICAL("CRITICAL", "严重"),
    NORMAL("NORMAL", "普通");

    private final String code;
    private final String description;

    public static PatrolPriorityLevel fromCode(String code) {
        for (PatrolPriorityLevel level : values()) {
            if (level.getCode().equals(code)) {
                return level;
            }
        }
        return NORMAL; // 默认返回普通
    }
}